package com.merryituxz.o2o.mapper;

import com.merryituxz.o2o.entity.Shop;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ShopMapper {
    /**
     * 插入店铺
     *
     * @param shop
     * @return
     */
    int insertShop(Shop shop);

    /**
     * 更新店铺信息
     *
     * @param shop
     * @return
     */
    int updateShop(Shop shop);

    /**
     * 通过shopId查询店铺
     *
     * @param shopId
     * @return
     */
    Shop queryByShopId(long shopId);

    /**
     * 分页查询店铺
     *
     * @param shopCondition 店铺查询条件
     * @param rowIndex      从第几行开始查
     * @param pageSize      返回的条数
     * @return
     */
    List<Shop> queryShopList(
            @Param("shopCondition") Shop shopCondition,
            @Param("rowIndex") int rowIndex,
            @Param("pageSize") int pageSize);

    /**
     * 查询给定条件下店铺的总数
     *
     * @param shopCondition 店铺查询条件
     * @return
     */
    int queryShopCount(@Param("shopCondition") Shop shopCondition);
}
